Skip to content

Conversation

@bijij
Copy link

@bijij bijij commented Aug 15, 2020

Attempts to handle a case where directories passed as a key to the ZoneInfo constructor will raise IsADirectoryError or PermissionError depending on OS.

This is achieved by first determining if the specified resource is a directory and raising when applicable.

Copy link
Owner

@pganssle pganssle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned on the CPython thread, this also needs tests (it will likely also need to be rebased against the master branch).

# (e.g. Australia)
# PermissionError: If the resource_name links to a directory on Windows
# (e.g. Pacific)
resource_path = importlib_resources.files(package_name).joinpath(key)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fairly certain this will fail on Python 3.8. I'm not sure why the test suite isn't executing to let you know this, though.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems you're correct here. Not at this time sure of a good alternative to what 3.9 does.

@pganssle
Copy link
Owner

I cannot force push to your branch and something is going on with the CI, so I've forked this in #92.

@pganssle pganssle closed this Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants